import request from '@/utils/request.js'
// 获取 公司 组织结构
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}
// 获取 对应 子部门
export function getDepartmentById(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}
// 删除 对应 子部门
export function delDepartmentById(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
// 添加 子部门
export function addDepartmentById(data) {
  return request({
    url: '/company/department/',
    method: 'POST',
    data
  })
}
// 修改 对应 子部门
export function editDepartmentById(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
